package zhr.chapter5.four;

public class Example5_4 {
    public static void main(String[] args) {
        Student mike = new Student("MIke",12,55);
        System.out.println(mike.getName());
        mike.doHomework();

        Monitor joy = new Monitor("Joy",13,5,"cleaning blackboard");
        System.out.println(joy.getName());
        joy.doHomework();
        joy.onDutt();

        Student aStudent = joy;
        aStudent.doHomework();
        if (aStudent instanceof Monitor)((Monitor)aStudent).onDutt();

        System.out.println("");

        HaveLesson.study(mike);
        HaveLesson.study(joy);
    }
    public class Anthropid{
        double m =12.58;
        void crySpeak(String s){
            System.out.println(s);
        }
    }
}
